import QtQuick
import QtQuick.Controls

Rectangle {
    width: 400
    height: 400

    SequentialAnimation {
        id: seqAnimation
        running: false
        NumberAnimation { target: rect1; property: "rotation"; from: 0; to: 315; duration: 500 }
        NumberAnimation { target: rect2; property: "rotation"; from: 0; to: 315; duration: 500 }
        NumberAnimation { target: rect3; property: "rotation"; from: 0; to: 315; duration: 500 }
    }

    Row {
        spacing: 20
        anchors.centerIn: parent

        Rectangle {
            id: rect1
            width: 80
            height: 80
            color: "pink"
        }

        Rectangle {
            id: rect2
            width: 80
            height: 80
            color: "cyan"
        }

        Rectangle {
            id: rect3
            width: 80
            height: 80
            color: "lime"
        }
    }

    Button {
        text: "启动动画"
        anchors.bottom: parent.bottom
        onClicked: {
            seqAnimation.start()
        }
    }
}
